Skip to content

Infrastructure/11740 playwright email reporting#12330

Merged
aaemnnosttv merged 41 commits into
developfrom
infrastructure/11740-playwright-email-reporting
Apr 10, 2026
Merged

Infrastructure/11740 playwright email reporting#12330
aaemnnosttv merged 41 commits into
developfrom
infrastructure/11740-playwright-email-reporting

Conversation

@eugene-manuilov
Copy link
Copy Markdown
Collaborator

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 17, 2026

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

📚 Storybook for 446fc7b:

  • Storybook has been deleted.

📦 Build files for 446fc7b:

  • Build files have been deleted.

🎭 Playwright reports for 446fc7b:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 17, 2026

Size Change: 0 B

Total Size: 2.31 MB

ℹ️ View Unchanged
Filename Size Change
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/index.js 42.7 kB 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/contribute-with-google/index.js 5.88 kB 0 B
dist/assets/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 5.07 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/index.js 5.88 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 5.07 kB 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/sign-in-with-google/index.js 18.6 kB 0 B
dist/assets/css/googlesitekit-admin-css-********************.min.css 67.1 kB 0 B
dist/assets/css/googlesitekit-adminbar-css-********************.min.css 12.3 kB 0 B
dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 846 B 0 B
dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 8.89 kB 0 B
dist/assets/js/146-********************.js 963 B 0 B
dist/assets/js/201-********************.js 2.85 kB 0 B
dist/assets/js/314-********************.js 100 kB 0 B
dist/assets/js/315-********************.js 3.08 kB 0 B
dist/assets/js/379-********************.js 3.7 kB 0 B
dist/assets/js/590-********************.js 1.89 kB 0 B
dist/assets/js/640-********************.js 2.36 kB 0 B
dist/assets/js/909-********************.js 1.01 kB 0 B
dist/assets/js/analytics-advanced-tracking-********************.js 475 B 0 B
dist/assets/js/googlesitekit-activation-********************.js 25.1 kB +8 B (+0.03%)
dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 59.6 kB +7 B (+0.01%)
dist/assets/js/googlesitekit-admin-pointers-tracking-********************.js 5.35 kB 0 B
dist/assets/js/googlesitekit-adminbar-********************.js 36.1 kB +9 B (+0.02%)
dist/assets/js/googlesitekit-api-********************.js 7.99 kB 0 B
dist/assets/js/googlesitekit-block-tracking-********************.js 5.55 kB 0 B
dist/assets/js/googlesitekit-components-********************.js 5.82 kB 0 B
dist/assets/js/googlesitekit-consent-mode-********************.js 25.5 kB 0 B
dist/assets/js/googlesitekit-data-********************.js 1.73 kB 0 B
dist/assets/js/googlesitekit-datastore-forms-********************.js 7.01 kB 0 B
dist/assets/js/googlesitekit-datastore-location-********************.js 1.51 kB 0 B
dist/assets/js/googlesitekit-datastore-site-********************.js 18.5 kB 0 B
dist/assets/js/googlesitekit-datastore-ui-********************.js 7.16 kB 0 B
dist/assets/js/googlesitekit-datastore-user-********************.js 23 kB 0 B
dist/assets/js/googlesitekit-entity-dashboard-********************.js 72.8 kB +16 B (+0.02%)
dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 1.27 kB 0 B
dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 655 B 0 B
dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 1.27 kB 0 B
dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 1.26 kB 0 B
dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 1.29 kB 0 B
dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 1.34 kB 0 B
dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 990 B 0 B
dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 1.29 kB 0 B
dist/assets/js/googlesitekit-i18n-********************.js 6.16 kB 0 B
dist/assets/js/googlesitekit-key-metrics-setup-********************.js 53.4 kB +10 B (+0.02%)
dist/assets/js/googlesitekit-main-dashboard-********************.js 149 kB +20 B (+0.01%)
dist/assets/js/googlesitekit-metric-selection-********************.js 57.9 kB +7 B (+0.01%)
dist/assets/js/googlesitekit-modules-********************.js 26.3 kB +5 B (+0.02%)
dist/assets/js/googlesitekit-modules-ads-********************.js 48.9 kB +10 B (+0.02%)
dist/assets/js/googlesitekit-modules-adsense-********************.js 138 kB +14 B (+0.01%)
dist/assets/js/googlesitekit-modules-analytics-4-********************.js 191 kB +6 B (0%)
dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 23.6 kB +10 B (+0.04%)
dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 52.7 kB +9 B (+0.02%)
dist/assets/js/googlesitekit-modules-search-console-********************.js 67.2 kB +7 B (+0.01%)
dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 34.7 kB +9 B (+0.03%)
dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.4 kB +8 B (+0.03%)
dist/assets/js/googlesitekit-notifications-********************.js 68.5 kB +7 B (+0.01%)
dist/assets/js/googlesitekit-polyfills-********************.js 230 B 0 B
dist/assets/js/googlesitekit-settings-********************.js 135 kB +15 B (+0.01%)
dist/assets/js/googlesitekit-splash-********************.js 78.5 kB +13 B (+0.02%)
dist/assets/js/googlesitekit-user-input-********************.js 51.4 kB +9 B (+0.02%)
dist/assets/js/googlesitekit-vendor-********************.js 328 kB 0 B
dist/assets/js/googlesitekit-widgets-********************.js 104 kB +9 B (+0.01%)
dist/assets/js/googlesitekit-wp-dashboard-********************.js 62.1 kB +8 B (+0.01%)
dist/assets/js/runtime-********************.js 1.92 kB 0 B

compressed-size-action

Comment thread tests/playwright/docker/fixtures/index.ts Dismissed
Comment thread tests/playwright/docker/fixtures/index.ts Dismissed

// Ensure every notice after the first notice has a margin
// so the notices don't render with no gap.
//
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylelint blamed this and insisted it be removed. 🤷‍♂️

@zutigrm zutigrm mentioned this pull request Mar 19, 2026
19 tasks
Copy link
Copy Markdown
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eugene-manuilov, this looks great overall, just a few things to address. Also note there are a few other comments from GitHub + annotations from JS Lint to review.

Comment thread tests/playwright/docker-compose.yml
Comment on lines +38 to +46
update_user_option(
get_current_user_id(),
'googlesitekit_site_verified_meta',
'verified'
);

$settings = get_option( Search_Console_Settings::OPTION );
$settings['propertyID'] = 'http://localhost:9002';
update_option( Search_Console_Settings::OPTION, $settings );
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use filters for these instead? Otherwise we're running these updates on every request. I think this is how we did it before, no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly updated it to update the search console settings only once. Re site verification, not sure why but it works only when i do it like that. If I switch to the filter hook, it stops working.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. I see we do it like that in our current E2E utility but it happens in a REST endpoint we call rather than on every request.

Comment thread tests/playwright/wordpress/mailpit.ts Outdated
Comment thread assets/js/components/Notice/index.js Outdated
Comment thread tests/playwright/specs/email-reporting/email-reporting.spec.ts Outdated
Comment thread tests/playwright/specs/email-reporting/email-reporting.spec.ts Outdated
*
* @param array $http_client_config Guzzle HTTP client configuration array.
*/
$http_client_config = apply_filters( 'googlesitekit_http_client_config', $http_client_config );
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not add a filter just for use in E2E, but I'm not sure there is another way. Alternatively, we could conditionally only apply it in tests/e2e – WDYT?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, i can't find another way how to do it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about this some more, I think we can overload the access token value which we're already controlling with a filter in tests to use a plain test-access-token. We can essentially append/embed additional metadata (or just pass json in this field, encoded if necessary) and then we can pass whatever we want through to the service and it will be contained in tests. This would be extensible to other values or configuration we want to send through as well. Yes, it gets encrypted (this is necessary) but it will be decrypted before being set in the authorization header. I think this should work since we should also never need to use a fixture for an unauthenticated response. Let me know what you think 👍

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea, updated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it turned out if we do it this way, auto-authorization stops working. I had to revert it to the previous approach with the filter. I think we can create a ticket to address this challenge separately.

Comment on lines +258 to +266
try {
startServers();
} catch ( err ) {
global.console.error(
'Failed to start HTTPS server:',
err instanceof Error ? err.message : String( err )
);
global.console.log( 'Continuing with HTTP only.' );
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startServers starts both http and https but there's no guarantee that http started successfully in the catch here, no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but that is correct. I don't really think we will actually need the http version though, because all APIs have https URLs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is that the messages here imply that http will always start but we can't say for sure. It would be better to just say that there was an error starting the servers and not claim that http will still work or that the error was from starting https specifically.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed extra logging

Comment thread tests/playwright/docker/wordpress/plugins/email-reporting.php Outdated
Copy link
Copy Markdown
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eugene-manuilov this one is almost there, back to you for a few final things. See also my comment/replies on previous threads which aren't listed below.

Comment thread tests/playwright/docker/wordpress/plugins/email-reporting.php Outdated
Comment thread tests/playwright/docker/wordpress/mu-plugins/e2e-mailpit.php Outdated
Comment thread includes/Core/Email_Reporting/Initiator_Task.php Outdated
Comment thread tests/playwright/docker/fixtures/index.ts Dismissed
Comment thread tests/playwright/wordpress/wordpress.ts Outdated
Copy link
Copy Markdown
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks @eugene-manuilov !

There is one unrelated JS test failing for the AMPContainerSelect which is unstable and we can fix in a follow up.

@aaemnnosttv aaemnnosttv merged commit f06abe4 into develop Apr 10, 2026
46 of 48 checks passed
@aaemnnosttv aaemnnosttv deleted the infrastructure/11740-playwright-email-reporting branch April 10, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants